package file;

import java.io.File;
import java.io.IOException;

public class Demo1 {
    public static void main(String[] args) throws IOException {
        // File file = new File("D:\\英语演讲.txt");
        File file = new File("./test.txt");
        System.out.println(file.exists());

        if(!file.createNewFile()){
            System.out.println("文件创建失败...");
        }

        System.out.println(file.exists());
        System.out.println(file.isFile());
        System.out.println(file.isDirectory());
        /*System.out.println(file.getParentFile());
        System.out.println(file.getName());
        System.out.println(file.getAbsoluteFile());
        System.out.println(file.getCanonicalPath());
        System.out.println(file.getAbsoluteFile());*/
    }
}
